Skip to content

Conversation

@Kavindu-Dodan
Copy link
Contributor

Description

Adds full field support for NLB log fields. The table below summarizes NLB field and OTel attribute it ends up (extracted from the updated documentation),

AWS Field OpenTelemetry Field(s)
connection_time aws.elb.connection_time
tls_handshake_time aws.elb.tls_handshake_time
incoming_tls_alert aws.elb.incoming_tls_alert
chosen_cert_arn aws.elb.chosen_cert_arn
chosen_cert_serial aws.elb.chosen_cert_serial
tls_named_group aws.elb.tls_named_group
alpn_fe_protocol aws.elb.alpn_fe_protocol
alpn_be_protocol aws.elb.alpn_be_protocol
alpn_client_preference_list aws.elb.alpn_client_preference_list
tls_connection_creation_time aws.elb.tls_connection_creation_time

Link to tracking issue

Fixes #43757

Testing

Unit tests already covered field parsing. But I have added both samples from official AWS NLB documentation at https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-access-logs.html#access-log-entry-format

Documentation

Documentation updated with the new attributes

Signed-off-by: Kavindu Dodanduwa <[email protected]>
Copy link
Contributor

@constanca-m constanca-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields look OK, just a comment about ignoring -

change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: extension/encoding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done with 4b4d2ea

@@ -1 +1,2 @@
tls 2.0 2018-12-20T02:59:40 net/my-network-loadbalancer/c6e77e28c25b2234 g3d4b5e8bb8464cd 72.21.218.154:51341 172.100.100.185:443 5 2 98 246 - arn:aws:acm:us-east-2:671290407336:certificate/2a108f19-aded-46b0-8493-c63eb1ef4a99 - ECDHE-RSA-AES128-SHA tlsv12 - my-network-loadbalancer-c6e77e28c25b2234.elb.us-east-2.amazonaws.com - - - 2018-12-20T02:59:30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Comparing the two logs, this only contains -

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the two examples from official AWS guide - https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-access-logs.html

IMO it's good to have them both here as one shows "TLS listener without an ALPN policy" & other with "TLS listener with an ALPN policy"

Comment on lines 52 to 57
- key: aws.elb.incoming_tls_alert
value:
stringValue: '-'
- key: aws.elb.tls_named_group
value:
stringValue: '-'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't include this -. This should be ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will cross check this among other signals and see what's needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes some checks were missing. I updated to fix this with 4b4d2ea

I have added unset check based on official AWS documentation of the NLB log - https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-access-logs.html#access-log-entry-format

Copy link
Contributor

@constanca-m constanca-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks much better, but there is still one issue in the code ⏬

Comment on lines +97 to +99
- key: aws.elb.tls_connection_creation_time
value:
stringValue: ',"http/1.1"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. Can you check @Kavindu-Dodan ?

Description for this field is:

tls_connection_creation_time: The time recorded at the beginning of the TLS connection, in ISO 8601 format.

So something must be off in the code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug is in the extractFields function. This is going to be a bit of a headache to fix... Which also reminds me, this function needs a unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[awslogsencodingextension] Add missing fields to ELB encoder extension

4 participants